import request from '../uniHttp';

// 添加角色
export const addRole = async (data?: object|any) => {
  return await request('/role/addRole', 'post', data);
}

// 获取所有角色
export const getRoleList = async (data?: object|any) => {
  return await request('/role/getRoleList', 'post', data);
}

// 通过id获取角色
export const getRole = async (id?: string|number) => {
  return await request('/role/getRole', 'get', id);
}

// 修改角色
export const updateRole = async (data?: object|any) => {
  return await request('/role/updateRole', 'post', data);
}

// 删除角色
export const deleteRole = async (id?: string|number) => {
  return await request('/role/deleteRole', 'delete', id);
}

// 角色绑定到用户
export const bindUser = async (data?: object|any) => {
  return await request('/role/bindUser', 'post', data);
}
